package voxietest1.jam;

import processing.core.PVector;
import voxbox.wrapper.VoxiMesh;
import voxbox.wrapper.VoxiPoint3d;
import voxbox.wrapper.VoxiScene;
import voxietest1.jam.lunar.Ship;

public class LunarScene extends VoxiScene {

	public Ship ship;
	PVector pointer;
	
	@Override
	public void mySetup() {
		ship = new Ship("dragonfly_1.kv6", new PVector(0, 0, 0f));
		ship.mySetup();
		
		pointer = new PVector();
	}

	@Override
	public void myUpdate() {
		ship.myUpdate();
		
		if(isClick){
			ship.mouseClicked();
		}
		
		pointer.x = scene.mouseX/400f;
		pointer.y = scene.mouseY/400f;
		pointer.z = -.5f;
		
		PVector heading = PVector.sub(pointer, ship.pos);
		ship.SetHeading(heading);
	}

	@Override
	public void myDraw() {
		ship.myDraw();
		voxi.voxi_drawsph(scene.frame,pointer.x, pointer.y, pointer.z, .1f, .1f, 7);
	}

}
